<?php
class InTransit 
{
	/*
	* 1. get all current occupancies
	* 2. find out how many days remaining (ie. roomsales)
	* 3. find out how much receivable based on roomsales data
	* 4. save to table
	**/
	
	var $dateToday;			/* 2010-01-01 */
	var $intShiftNumber;	/* 1, 2, 3 */
	var $intSite; 			/* WU, S1, S2 */
	
	public function InTransit($arrConfig) {
		$dateToday = 
		foreach ($arrConfig as $key => $value) {
			$this->{$key} = $value;
		}
	}
	
	public function runBatch() {
		$this->getOccupancies();
		$sql = " select occupancy_id from occupancy 
				where actual_checkout='0000-00-00 00:00:00' ";
		$res = mysql_query($sql) or die( mysql_error() . ' -- ' . $sql);
		if (mysql_num_rows($res)) {
			while( list($occupancyId) = mysql_fetch_row($res) ) {
				$sql = " select roomsales_id, unit_cost, qty 
				from room_sales 
				where occupancy_id=$occupancy 
				and sales_date > 
				";
			}
		}
	}
	
	public function getOccupancies() {
		
	}
	
	public function getDetails($occupancy) {
		
		
	}
}
?>